package com.example.controller;

import com.example.dto.OrderFromDto;
import com.example.dto.ProDto;
import com.example.dto.VipDto;
import com.example.service.CountService;
import com.example.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("count")
public class CountController {
    @Autowired
    private CountService service;

    @RequestMapping("total")
    public Result add() {

        Map<String, Object> countMap = service.count();
        List<ProDto> proSort = service.proSort();
        List<OrderFromDto> vipSort = service.vipSort();
        return Result.success("查询完成").put("count",countMap).put("proSort",proSort).put("vipSort",vipSort);
    }

}
